<ui:composition template="/dynamic/layout/login_layout.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


	<ui:define name="content">
		<script type="text/javascript">
		$(document)
		.ready(
				function() {
					if(${not empty param.login_error}){
						alert("Niepoprawne dane logowania.");
					}

				});
		</script>
		<h:form id="loginForm" prependId="false">
			<div id="panel">
				<div id="panel_contents"></div>
				<div style="margin-top: 80px; z-index: 1000;">

					<p:dialog id="dialog" widgetVar="dlg" resizable="false"
						style="z-index: 1500;" draggable="false" modal="true" width="473">
						<p:growl id="growl" showDetail="true" />
						<h:panelGrid columns="2" cellpadding="5">
							<h:outputLabel for="j_username" value="Login:" />
							<p:inputText id="j_username" required="true" label="Login"
								requiredMessage="Login jest wymagany." />

							<h:outputLabel for="j_password" value="Hasło:" />
							<p:password id="j_password" label="Hasło" required="true"
								requiredMessage="Hasło jest wymagane." />
							<h:outputLabel for="_spring_security_remember_me"
								value="Zapamiętaj mnie." />
							<h:selectBooleanCheckbox id="_spring_security_remember_me" />
							<f:facet name="footer">
								<p:commandLink type="submit" action="#{userMBean.doLogin}"
									update="growl" ajax="false">
									<img src="static/images/p_logowania.png" alt="logowanie" />
								</p:commandLink>
							</f:facet>
						</h:panelGrid>

					</p:dialog>
				</div>

			</div>

			<div class="panel_button" id="show"
				style="display: visible; margin-top: 40px">
				<p:commandLink onclick="PF('dlg').show()">
					<img src="static/images/logowanie.png" alt="expand" />
				</p:commandLink>
			</div>
			<div class="panel_button" id="hide_button" style="display: none;">
				<a href="#"><img src="static/images/collapse.png" alt="collapse" /></a>
			</div>
			<div class="register_button"
				style="display: visible; margin-top: 20px;">
				<p:commandLink id="registration" immediate="true"
					action="#{userMBean.doRegister}" styleClass="register">
					<p:graphicImage value="static/images/rejestracja.png" />
				</p:commandLink>
			</div>
		</h:form>

	</ui:define>
</ui:composition>